package br.com.sicoob.cedente.transacao;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * @author vinicius.florentino
 *
 */
public class ResourceLoader {
	
	private static String path;

	public static void setPath(String path) {
		ResourceLoader.path = path;
	}
	
	public static InputStream getFormatoAsStream(String nome) {
		try {
			if(path != null) {
				return new FileInputStream(new File(path+nome));	
			}
			return new FileInputStream(new File(nome)); 
		} catch (FileNotFoundException e) {
			return null;
		}
	}
	
	
}
